<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    body {
        margin: 0;
        padding: 0;
        background-color: #f1f1f1;
    }
    p{
        margin-top: 100px;
        text-align: center;
        color: #4CAF50;
    }
    form {
        width: 30%;
        margin: 0 auto;
        padding: 20px;
        border: 1px solid #ccc;
        background-color: #fff;
    }
    input[type="file"] {
        width: 100%;
        margin-bottom: 10px;
    }
    input[type="submit"] {
        width: 100%;
        padding: 10px;
        background-color: #4CAF50;
        color: #fff;
        border: none;
        cursor: pointer;
    }
    input[type="submit"]:hover {
        background-color: #45a049;
    }
    table {
        width: 30%;
        margin: 0 auto;
        margin-top: 20px;
        border-collapse: collapse;
    }
    th, td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: center;
    }
    th {
        background-color: #e5e5e5;
    }
    tr{
        background-color: #f5f5f5;
    }
    tr:nth-child(even) {
        background-color: #f8f8f8;
    }
    tr th:nth-child(2), tr td:nth-child(2) {
        width: 100px;
    }
    tr:hover {
        background-color: #f1f1f1;
    }
    a {
        display: inline-block;
        padding: 6px 12px;
        margin-bottom: 0;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.42857143;
        text-align: center;
        white-space: nowrap;
        vertical-align: middle;
        cursor: pointer;
        background-image: none;
        border: 1px solid transparent;
        border-radius: 4px;
        text-decoration: none;
        color: #fff;
        background-color: #5cb85c;
        border-color: #4cae4c;
    }
</style>
<body>
    <p th:if="${session.uploadResult != null}" th:text="${session.uploadResult}"></p>
    <form method="post" action="/upload" enctype="multipart/form-data">
        <input type="file" name="file" />
        <input type="submit" value="Upload" />
    </form>
    <div>
        <table>
            <tr>
                <th>文件名</th>
                <th></th>
            </tr>
            <tr th:each="file : ${session.fileList}">
                <td th:text="${file.getKey()}">文件名</td>
                <td><a th:href="'/download?filename='+${file.getKey()}">下载</a></td>
            </tr>
        </table>
    </div>
</body>
</html>